<ul class="sf_admin_td_actions">
<li class="sf_admin_action_edit">
<?php if($material->getTypeId()==1):?>
                <?php 
                echo link_to_remote(__('Редактировать'), array(
			    'update' => 'add_material_form',
                'script'=>'true',
			    'url'    => url_for('material/show_material_form?type='.$material->getTypeId().'&mat_id='.$material->getId()),
			    'loading'  => "Element.show('add_material_indicator');Element.hide('materials');",
			    'complete' => "Element.hide('add_material_indicator');bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });",
			    ));
                ?>
<?php endif ?>
<?php if($material->getTypeId()==2):?>
                <?php 
                //echo link_to(__('Редактировать'),'material/edit?no_ajax=true&id='.$material->getId());
                
                 echo link_to_remote(__('Редактировать'), array(
			    'update' => 'add_material_form',
                'script'=>'true',
			    'url'    => url_for('material/show_material_form?type='.$material->getTypeId().'&mat_id='.$material->getId()),
			    'loading'  => "Element.show('add_material_indicator');Element.hide('materials');",
			    'complete' => "Element.hide('add_material_indicator');bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });",
			    ));
                
                ?>

<?php endif ?>                
                </li>	
                </ul>